//
//  MePrizeViewController.m
//  RainbowFM
//
//  Created by jv on 14-12-13.
//  Copyright (c) 2014年 RB. All rights reserved.
//

#import "MePrizeViewController.h"
#import "ActivityModel.h"

@interface MePrizeViewController (){
    NSMutableArray *listArray;
}

@end

@implementation MePrizeViewController


-(void)fetchListData{
    [listArray removeAllObjects];
    [[ActivityModel sharedModel] fetchMyPrizeListWithPage:1 result:^(BOOL success, NSArray *array) {
        [listArray addObject:array];
        [self.tableView reloadData];
    }];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    listArray = [NSMutableArray array];
    [self fetchListData];
    // Do any additional setup after loading the view.
}


#pragma mark - table datasource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return listArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MePrizeCell"];
    
    
    return cell;
}


#pragma mark - table delegate


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 100.f;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    _Nav2SelfViewControl(@"MePrizeDetail");
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
